import { lazy } from 'react'
import { createBrowserRouter } from 'react-router-dom'

const Login = lazy(() => import('../pages/login/Login'))
const Index = lazy(() => import('../pages/index/Index'))
let router = createBrowserRouter([
  {
    path: '/',
    element: <Index />,
    children: [
      {
        path: '/public',
        element: <div>tongyong</div>,
        children: [
          {
            path: 'button',
            element: <div>button</div>
          },
          {
            path: 'icon',
            element: <div>icon</div>
          },
          {
            path: 'others',
            element: <div>其他</div>,
            children: [
              {
                path: 'table',
                element: <div>表格</div>
              },
              {
                path: 'richtext',
                element: <div>富文本</div>
              }
            ]
          }
        ]
      },
      {
        path: '/about',
        element: <div>关于</div>
      }
    ]
  },
  {
    path: '/login',
    element: <Login />
  }
])
export default router
